<?php

/** 
* 
* 
* by:南宁火蝶科技有限公司 http:///www.HdsysCms.com
* 声明:本系统禁止用二次开发、侵犯HdsysCms著作和除去HdsysCms进行售卖,如发现将追究一切权利,模版制作属于自己所得可以通过本系统对外开发模版获取收益!
* 
* 2019年第一版本发布 - 到2023.9.1开源使用! 
* php混淆工具:phpencry.wbox.top
* 
* 注意防骗:@HdsysCms 官方没授权任何个人机构合作,唯一收款抬头:《南宁火蝶科技有限公司》和官网显示客服唯一渠道客服,其它渠道以HdsysCms名义行为均骗子!
*
*/
	

function call_my_template_open($param_open, $param_dir, $param_host='../')
{
if ($param_open=='index.hdsys.php') {
$param_url='index.php/index.html';
} else
if ($param_open=='list.download.hdsys.php') {
$param_sql="SELECT * FROM `hdsys_list` WHERE `template`='download'";
$param_array=plug_query_assoc($param_sql);
$param_url="index.php/{$param_array['static_url']}.html";
} else
if ($param_open=='list.picture.hdsys.php') {
$param_sql="SELECT * FROM `hdsys_list` WHERE `template`='picture'";
$param_array=plug_query_assoc($param_sql);
$param_url="index.php/{$param_array['static_url']}.html";
} else
if ($param_open=='list.product.hdsys.php') {
$param_sql="SELECT * FROM `hdsys_list` WHERE `template`='product'";
$param_array=plug_query_assoc($param_sql);
$param_url="index.php/{$param_array['static_url']}.html";
} else
if ($param_open=='list.page.hdsys.php') {
$param_sql="SELECT * FROM `hdsys_list` WHERE `template`='page'";
$param_array=plug_query_assoc($param_sql);
$param_url="index.php/{$param_array['static_url']}.html";
} else
if ($param_open=='list.news.hdsys.php') {
$param_sql="SELECT * FROM `hdsys_list` WHERE `template`='news'";
$param_array=plug_query_assoc($param_sql);
$param_url="index.php/{$param_array['static_url']}.html";
} else
if ($param_open=='tags.hdsys.php') {
$param_sql="SELECT * FROM `hdsys_tags`  LIMIT 1 ";
$param_array=plug_query_assoc($param_sql);
$param_url="index.php/tags-i-{$param_array['id']}.html";
} else
if (preg_match('/list.download_(.*?)\./', $param_open, $param_mac)==true) {
$param_sql="SELECT * FROM `hdsys_list` WHERE `template`='download_{$param_mac[1]}'";
$param_array=plug_query_assoc($param_sql);
$param_url="index.php/{$param_array['static_url']}.html";
} else
if (preg_match('/list.picture_(.*?)\./', $param_open, $param_mac)==true) {
$param_sql="SELECT * FROM `hdsys_list` WHERE `template`='picture_{$param_mac[1]}'";
$param_array=plug_query_assoc($param_sql);
$param_url="index.php/{$param_array['static_url']}.html";
} else
if (preg_match('/list.product_(.*?)\./', $param_open, $param_mac)==true) {
$param_sql="SELECT * FROM `hdsys_list` WHERE `template`='product_{$param_mac[1]}'";
$param_array=plug_query_assoc($param_sql);
$param_url="index.php/{$param_array['static_url']}.html";
} else
if (preg_match('/list.page_(.*?)\./', $param_open, $param_mac)==true) {
$param_sql="SELECT * FROM `hdsys_list` WHERE `template`='page_{$param_mac[1]}'";
$param_array=plug_query_assoc($param_sql);
$param_url="index.php/{$param_array['static_url']}.html";
} else
if (preg_match('/list.news_(.*?)\./', $param_open, $param_mac)==true) {
$param_sql="SELECT * FROM `hdsys_list` WHERE `template`='news_{$param_mac[1]}'";
$param_array=plug_query_assoc($param_sql);
$param_url="index.php/{$param_array['static_url']}.html";
} else
if (preg_match('/(.*?).hdsys.php/', $param_open, $param_mac)==true) {
$param_url="index.php/{$param_mac[1]}.html";
} else
if (preg_match('/(.*?).hdsys.php/', $param_open, $param_mac)==true) {
$param_url="index.php/{$param_mac[1]}.html";
} else {
$param_url=str_replace('.hdsys.php', '', $param_open);
}
return $param_host . $param_url . '?template=' . $param_dir;
}
